package com.gxm.算法;

import org.junit.Test;

public class MaoPao {

    @Test
    public void test() {
        int[] array = { 7, 2, 5, 4, 3, 6 };

        for (int i = 0; i < array.length - 1; i++) {
            for (int j = 0; j < array.length - 1 - i; j++) {
                if (array[j] > array[j + 1]) {
                    int temp = array[j];
                    array[j] = array[j + 1];
                    array[j + 1] = temp;
                }
            }
        }

        for (int i : array) {
            System.out.print(i+" ");
        }
        System.out.println();
    }
}
